package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.DstPosterDTO;
import com.financing.wap.dao.IDstPosterDao;
import com.financing.wap.common.SqlName;
/**
 * dst_poster  
 * 宣传海报 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("dstPosterDao")
public class DstPosterDaoImpl extends BaseDaoImpl<DstPosterDTO, java.lang.Integer> implements IDstPosterDao {


	@Override
	public int insert(DstPosterDTO dstPoster) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.DstPosterSql.insert, dstPoster);
	}

	@Override
	public void update(DstPosterDTO dstPoster) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstPosterSql.update, dstPoster);
	}

	@Override
	public void updateForce(DstPosterDTO dstPoster) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstPosterSql.updateForce, dstPoster);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.DstPosterSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<DstPosterDTO> queryList(DstPosterDTO dstPoster) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.DstPosterSql.queryList, dstPoster);
	}

	@Override
	public int queryListCount(DstPosterDTO dstPoster) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.DstPosterSql.queryListCount, dstPoster);
	}

	@Override
	public DstPosterDTO loadById(Integer id) throws SQLException {
		return  (DstPosterDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.DstPosterSql.loadById,id);
	}

	@Override
	public Class<DstPosterDTO> getEntityClass() {
		return DstPosterDTO.class;
	}
 	
}
